;;;Strips duplicate vertices from LWpolylines
(defun c:stript ()
  (SETQ plss (SSGET "x" '((0 . "LWPOLYLINE"))))
  (SETQ plsslen (SSLENGTH plss))
  (SETQ plstep 0)
  (SETQ modcnt 0)
  (PRINC (STRCAT "\nProcessing " (ITOA plsslen) " LWPOLYLINEs"))
  (princ)
  (WHILE (< plstep plsslen)
    (SETQ newplent NIL)
    (IF (AND (> plstep 0)(EQ (REM plstep 10) 0))
      (progn
        (princ ".")
        (princ)
      )
    )
    (SETQ curplent (ENTGET (SSNAME plss plstep)))
    (setq skippt nil)
    (foreach n curplent
      (if (or (AND (member n newplent)(EQ(CAR n)10))(AND skippt (< skippt 4)))
        (if skippt
          (IF (>= skippt 4)
            (SETQ skippt 1)
            (setq skippt (1+ skippt))
          )
          (setq skippt 1)
        )
        (progn
          (setq skippt nil)
          (setq newplent (append newplent (list n)))
        )
      )
;;;      (princ "\n")
;;;      (princ n)
;;;      (princ)
    )
    (IF (ENTMOD newplent)
      (SETQ modcnt (1+ modcnt))
    )
    (SETQ plstep (1+ plstep))
  )
  (IF (EQ modcnt 0)
    (PRINC (STRCAT "\nNo duplicate LWPOLYLINE vertices found! "))
    (PRINC (STRCAT "\nRemoved duplicate vertices from " (ITOA modcnt) " LWPOLYLINE" (IF (> modcnt 1) "s! " "! ")))
  )
  (princ)
)